<?php


namespace support\command\workerman;

use app\common\gateway\data\GroupSender;
use app\common\gateway\data\JsonData;
use GatewayWorker\Gateway;
use Workerman\Lib\Timer;

class GatewayWorker implements Worker
{
    const TOKEN_KEY = 'abcdefg';

    public function register()
    {
        $config = config('gateway.gateway');
        $register = config('gateway.register');
        $gateway = new Gateway("websocket://". $config['ip'] . ":" . $config['port']);
        $gateway->name                 = $config['name'];
        $gateway->count                = $config['count'];
        $gateway->lanIp                = $config['lanIp'];
        $gateway->startPort            = $config['startPort'];
        $gateway->pingInterval         = $config['pingInterval'];
        $gateway->pingNotResponseLimit = $config['pingNotResponseLimit'];
        $gateway->pingData             = $config['pingData'];
        $gateway->registerAddress      = $config['registerAddress'] . ':' . $register['port'];
    }
}
